<?php include('style/header-1.php');//hieronder komt de linkerbalk met artikelen ?>
<?php include('menu.php');//dit zorgt ervoor dat het menu verschijnt. ?>
<?php include('style/body-2.php');//hieronder het midden van de pagina ?>

<?php
include ('config.php');
$tbl_name="artikelen"; // Table name



// Define $myusername and $mypassword 
$id=$_POST['id'];
$name=$_POST['name']; 
$prijs=$_POST['prijs']; 
$name2=$_POST['name2']; 
$name3=$_POST['name3'];
$value=$_POST['value'];
$description=$_POST['description'];
$imagefilename=$_POST['imagefilename'];
$category=$_POST['category'];
$subcategory1=$_POST['subcategory1'];
$subcategory2=$_POST['subcategory2'];
$subcategory3=$_POST['subcategory3'];
$korting=$_POST['korting'];


/* To protect MySQL injection 
$myname = stripslashes($myname);
$myemail = stripslashes($myemail);
$myadres = stripslashes($myadres);
$mypostcode = stripslashes($mypostcode);
$mywoonplaats = stripslashes($mywoonplaats);
$mytelefoon = stripslashes($mytelefoon);
$myname = mysql_real_escape_string($myname);
$myemail= mysql_real_escape_string($myemail);
$myadres= mysql_real_escape_string($myadres);
$mypostcode = mysql_real_escape_string($mypostcode);
$mywoonplaats = mysql_real_escape_string($mywoonplaats);
$mytelefoon = mysql_real_escape_string($mytelefoon);
*/

$sql2="UPDATE $tbl_name SET idartikelen='$id', name='$name', price='$prijs', name2='$name2', name3='$name3', value='$value', description='$description', imagefilename='$imagefilename', category='$category', subcategory1='$subcategory1',subcategory2='$subcategory2',subcategory3='$subcategory3', korting='$korting' WHERE idartikelen='$id'";      
$result =mysql_query($sql2) or die (mysql_error());

echo("Het artikel is succesvol aangepast");
?>
<?php include('style/body-3.php');//hieronder de rechterbalk ?>
<?php include('style/footer-4.php');?>